<script type="text/javascript">
function  deleteMy(id , name){
	if (confirm("<?PHP LangText('DeleteMas'); ?>")) {//if yes
	   window.location =document.URL+'&AbteilungID='+id;
	}
}
</script>
<?php
LangText('contaktInfo');
include("modules/Firma/FirmaEdit.php");
if(!empty($_GET['AbteilungID'])){
	$sql = 'DELETE  FROM abteilung WHERE ID='.$_GET['AbteilungID'];
	mysql_query($sql, $_db_link);
}
if($FirmaID){
	$sql="select * From abteilungview WHERE FirmaID=$FirmaID";
	$_rd=mysql_query($sql,$_db_link);
	$str="";
	if($_rd){
		$sw="row1";
		$str="<div class='FirmaView'><table class='FirmaList'>
		<tr class='$sw'>
		<td><b>".LangTextOut("ID")."</b></td>
		<td><b>".LangTextOut("FirmaName")."</b></td>
		<td><b>".LangTextOut("Kategorie")."</b></td>
		<td><b>".LangTextOut("Detail")."</b></td>
		<td><b>".LangTextOut("delete")."</b></td>" .
		"</tr>";
		while($daten=mysql_fetch_array($_rd,MYSQL_ASSOC)){
			if($sw=="row1"){
				$sw="row2";
				}else{
				$sw="row1";
			}
			$str=$str."<tr class='$sw'>
			<td>".$daten["ID"]."</td>
			<td>".$daten["Name"]."</td>
			<td>".$daten["kategorie"]."</td>
			<td><a href='index.php?tag=$tagID&page=AbteilungEditPro&MoudeTagID=$MoudeTagID&FirmaID=".$FirmaID."&AbteilungID=".$daten["ID"]."'>"
			.LangTextOut("Detail")."</a></td>" .
			"<td><a  href=\"javascript:deleteMy('".$daten["ID"]."','".$daten["Name"]."');\"  >".LangTextOut("Delete")."</a>" .
					"</td>".
			"</tr>";
			}	
		$str=$str."</table></div>";
	}
	$str=$str."<hr>
	<a class='BootenLink' href='index.php?tag=$tagID&page=AbteilungEditPro&FirmaID=".$FirmaID."&MoudeTagID=$MoudeTagID'>"
	.LangTextOut("AbteilungHinzufugen")."</a>";
	echo $str;
}
?>

